.usa-footer {
  .usa-unstyled-list {
    display: block;
  }

  .usa-footer-primary-link {
    color: $color-base;
    display: block;
    font-weight: $font-bold;
    margin-top: 0;
    padding-bottom: 2rem;
    padding-top: 2rem;
    text-decoration: none;

    @include media($medium-screen) {
      border-top: none;
    }

    &:hover {
      text-decoration: underline;
    }
  }

  a {
    font-weight: normal;
  }
}

.usa-footer-return-to-top {
  padding-bottom: 2rem;
  padding-top: 2rem;
}

.usa-footer-primary-section {
  background-color: $color-gray-lightest;

  .usa-footer-primary-content {
    padding-left: 2.5rem;
    padding-right: 2.5rem;

    @include media($medium-screen) {
      padding-left: 0;
      padding-right: 0;
    }

    li {
      margin-left: 1rem;

      @include media($medium-screen) {
        margin-left: 0;
      }
    }
  }

  .usa-grid-full {
    @include media($medium-screen) {
      padding-left: 2.5rem;
      padding-right: 2.5rem;
    }
  }
}

.usa-footer-medium {
  .usa-footer-primary-section {
    padding: 0;

    @include media($medium-screen) {
      padding-bottom: 1rem;
      padding-top: 1rem;
    }
  }

  .usa-footer-nav ul {
    @include media($medium-screen) {
      align-items: center;
    }
  }
}

.usa-footer-slim {
  .usa-footer-nav a {
    display: block;
  }

  .usa-footer-primary-section {
    padding-bottom: 2rem;

    @include media($medium-screen) {
      padding-bottom: 1rem;
      padding-top: 1rem;

      .usa-grid-full {
        align-items: center;
      }
    }
  }

  .usa-footer-contact_info {
    > * {
      @include media($medium-screen) {
        margin: 0;
      }
    }

    @include media($medium-screen) {
      @include padding (2rem null);
    }

    @include media($medium-screen) {
      width: 100%;
    }

    @include media($large-screen) {
      @include span-columns(6);
    }
  }
}

// scss-lint:disable QualifyingElement
ul.usa-footer-primary-content,
li.usa-footer-primary-content,
li.usa-footer-primary-content {
  border-top: 1px solid $color-base;

  @include media($medium-screen) {
    border: none;
  }

  &:last-child {
    border-bottom: 1px solid $color-base;

    @include media($medium-screen) {
      border-bottom: none;
    }
  }
}
// scss-lint:enable QualifyingElement

.usa-sign_up-block {
  padding-bottom: 2rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;

  @include media($medium-screen) {
    float: right;
    padding: 0;
  }

  label:first-of-type {
    margin-top: 0;
  }

  button {
    float: none;
    margin-right: 0;
    margin-top: 1.5rem;
  }

  input {
    width: 100%;
  }
}

.usa-footer-secondary_section {
  background-color: $color-gray-lighter;
  padding-bottom: 3rem;
  padding-top: 3rem;

  a {
    color: $color-base;
  }
}

.usa-footer-big-secondary-section {
  @include media($medium-screen) {
    padding-top: 5rem;
  }
}

.usa-footer-contact-links {
  @include media($medium-screen) {
    text-align: right;
  }
}

.usa-social-links {
  a {
    text-decoration: none;
  }
}

.usa-footer-big {
  .usa-footer-primary-section {
    @include media($medium-screen) {
      padding-bottom: 4rem;
      padding-top: 3rem;
    }
  }

  ul {
    padding-bottom: 2.5rem;

    @include media($medium-screen) {
      padding-bottom: 0;
    }

    &:last-child {
      border-bottom: 1px solid $color-base;

      @include media($medium-screen) {
        border-bottom: none;
      }
    }

    li {
      line-height: 2em;
    }

    .usa-footer-primary-link {
      background-image: url('#{$image-path}/arrow-down.png');
      background-image: url('#{$image-path}/arrow-down.svg');
      background-position: 1.5rem center;
      background-repeat: no-repeat;
      background-size: 1.3rem;
      margin-left: 0;
      padding-left: 3.5rem;

      @include media($medium-screen) {
        background: none;
        margin-bottom: .8rem;
        padding-bottom: 0;
        padding-left: 0;
      }

      // scss-lint:disable SelectorDepth
      > * {
        @include margin(0 null);
      }
    }

    &.hidden {
      padding-bottom: 0;

      li { display: none; }

      .usa-footer-primary-link {
        background-image: url('#{$image-path}/arrow-right.png');
        background-image: url('#{$image-path}/arrow-right.svg');
        cursor: pointer;
        display: block;

        @include media($medium-screen) {
          background: none;
          padding-left: 0;
        }
      }
    }
  }
}

.usa-footer-topic {
  margin: 0;
  padding: 2rem 0;
}

.usa-sign_up-header {
  @include media($medium-screen) {
    margin: 0;
    padding: 2rem 0;
  }
}

.usa-footer-logo-img {
  max-width: 14rem;
}

.usa-footer-slim-logo-img {
  float: left;
  max-width: 10rem;
}

.usa-footer-logo-heading {
  margin-top: 2rem;
}

.usa-footer-contact-heading {
  margin-top: 0;

  @include media($medium-screen) {
    margin-top: 1rem;
  }
}

.usa-footer-slim-logo-heading {
  display: block;
  padding-top: 1rem;

  @include media($medium-screen) {
    display: inline-block;
    padding-left: 1em;
  }
}

.usa-social_link {
  $background-height: 3rem; // Height of icon within hit area.
  $hit-area: 4.4rem; // Link hit target is 44 x 44 pixels following Apple iOS
                     // Human Interface Guidelines.
  @include margin(2.5rem 1rem 1.5rem 0);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: auto $background-height;
  display: inline-block;
  height: $hit-area;
  left: -1.6rem; // relative left positioning
  position: relative;
  text-align: center;
  width: $hit-area;

  @include media($medium-screen) {
    @include margin(0 0 0 1rem);
    left: 1.2rem;
  }

  span {
    @include sr-only();
  }
}

.usa-link-facebook {
  @extend .usa-social_link;
  background-image: url('#{$image-path}/social-icons/png/facebook25.png');
  background-image: url('#{$image-path}/social-icons/svg/facebook25.svg');
}

.usa-link-twitter {
  @extend .usa-social_link;
  background-image: url('#{$image-path}/social-icons/png/twitter16.png');
  background-image: url('#{$image-path}/social-icons/svg/twitter16.svg');
}

.usa-link-youtube {
  @extend .usa-social_link;
  background-image: url('#{$image-path}/social-icons/png/youtube15.png');
  background-image: url('#{$image-path}/social-icons/svg/youtube15.svg');
}

.usa-link-rss {
  @extend .usa-social_link;
  background-image: url('#{$image-path}/social-icons/png/rss25.png');
  background-image: url('#{$image-path}/social-icons/svg/rss25.svg');
}
